module(
    name = "rules_synology",
    version = "0.0.2",
)

bazel_dep(name = "aspect_bazel_lib", version = "2.9.1")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "gazelle", version = "0.39.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.10")
bazel_dep(name = "rules_go", version = "0.50.1")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_shellcheck", version = "0.3.3", repo_name = "com_github_aignas_rules_shellcheck")
bazel_dep(name = "stardoc", version = "0.7.1")

bazel_dep(name = "buildifier_prebuilt", version = "7.3.1", dev_dependency = True)

http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")

http_file(
    name = "screaming_goat",
    sha256 = "030c1aadeaf9b7b01b27d4966a64173fbfe2e0eea2ec3577543fb8838c3013f0",
    urls = [
        "https://dehayf5mhw1h7.cloudfront.net/wp-content/uploads/sites/816/2019/01/22193028/Screaming-Goat-832-832x476.jpg",
    ],
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")

#Download toolchain for this version for both host and some platform targets (maybe the right ones)
go_sdk.download(version = "1.22.4")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//:go.mod")

# Include *direct* Go dependencies
use_repo(go_deps, "com_github_disintegration_imaging")

#
# Toolchains
#

toolchains = use_extension("//toolchains:extensions.bzl", "synology_deps")

#synology_toolchains = use_extension("//toolchains:extensions.bzl", "synology_toolchains")
use_repo(
    toolchains,
    "arm64_gcc_linux_x86_64",
    "armada37xx-gcc850_glibc226_armv8-GPL",
    "denverton-gcc850_glibc226_x86_64-GPL",
    "geminilake-gcc850_glibc226_x86_64-GPL",
    #
    "bazelisk_darwin_amd64",
    "bazelisk_darwin_arm64",
)
